<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$this_group.title} －  成员管理</title>

    <!-- Bootstrap -->
    <link href="{:config('__public__')}/static/bootstrap-3.3.4/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="main-title">
    <h2><span>{$this_group.title}</span> - 角色成员管理</h2>
</div>

	<ul class="nav nav-tabs" role="tablist">
	    <li role="presentation">
	        <a href="{:URL('AuthManager/access',array('group_name'=>input('group_name') ,'group_id'=> input('group_id')))}">访问授权</a>
	    </li>
	    <li role="presentation" class="active">
	        <a href="javascript:;">成员管理</a>
	    </li>
	    <li class="pull-right">
	        分组选择：
	        <select name="group">
	            {volist name="auth_group" id="vo"}
				    <option value="{:URL('AuthManager/groupUsers',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" {eq name="vo['id']" value="$this_group.id"}selected{/eq} >{$vo.title}</option>
			    {/volist}
	        </select>
	    </li>
	</ul>

	<div class="container">
		<div class="pull-right">
			<form class="ajaxForm form-inline" action="{:URL('addToGroup')}" method="post" enctype="application/x-www-form-urlencoded" >
				<div class="form-group">
				<input type="hidden" name="group_id" value="{:input('group_id')}">
				<input class="form-control" type="text" name="uid" placeholder="请输入uid,多个用英文逗号分隔">
                <button type="submit" class="btn btn-success btn-sm" target-form="add-user">新 增</button>
            </div>
			</form>
		</div>
	</div>
    <!-- 数据列表 -->
	<table class="table table-striped table-condensed table-responsive">
    <thead>
        <tr>
		<th class="">ID</th>
		<th class="">用户名</th>
		<th class="">昵称</th>
		<th class="">手机号</th>
		<th class="">邮箱</th>
		<th class="">状态</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
    	{notempty name="group_users"}
		{volist name="group_users" id="vo"}
		<tr>
			<td>{$vo.id} </td>
			<td>{$vo.username} </td>
			<td>{$vo.nickname}</td>
			<td>{$vo.mobile}</td>
			<td>{$vo.email}</td>
			<td>{$vo.status}</td>
			<td><a href="{:URL('AuthManager/removeFromGroup?uid='.$vo['id'].'&group_id='.input('group_id'))}" class="ajax-get">解除授权</a>
                </td>
		</tr>
		{/volist}
		{else /}
		<tr><td colspan="7" class="text-center">暂无数据</td></tr>
		{/notempty}
	</tbody>
    </table>


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="{:config('__public__')}/static/form-3.51/jquery.form.js"></script>
<link rel="stylesheet" href="{:config('__public__')}/static/artDialog-6.0.4/css/ui-dialog.css">
<script src="{:config('__public__')}/static/artDialog-6.0.4/dist/dialog-min.js"></script>
<script src="{:config('__public__')}/Admin/js/ajaxSubmit.js"></script>

<script type="text/javascript">
	$('select[name=group]').change(function(){
        location.href = this.value;
    });
</script>
</body>
</html>